/***************************************************************************
 *   Copyright (C) 2008 by Chris Vickery   *
 *   chrisinajar@gmail.com   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QObject>
#include <irrlicht.h>
#include <QPointer>

#define MWindow() (MainWindow::instance())

/**
	@author Chris Vickery <chrisinajar@gmail.com>
	
	This class is the main graphical and event class. Just about everything is based on this class, so most of the global Irrlicht related functions are in here. Also, the program is created and destroyed here.
 */
class MainWindow : public QObject
{
	Q_OBJECT
	public:
		MainWindow(QObject *parent);
		static MainWindow* instance();
		~MainWindow();
		
		// irrlicht objects, public because everything else uses them too...
		irr::IrrlichtDevice *device;
		irr::video::IVideoDriver* driver;
		irr::scene::ISceneManager* smgr;
		irr::gui::IGUIEnvironment* guienv;
		
	public slots:
		void closeApp();
		
	private slots:
		void showMenu2();
		void showMainMenu();
		void init();
		void runLoop();
		
	signals:
		void clearMenu();
		
	private:
		int width;
		int height;

};

#endif
